.class public abstract Lorg/springframework/util/CollectionUtils;
.super Ljava/lang/Object;
.source "CollectionUtils.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/springframework/util/CollectionUtils$EnumerationIterator;
    }
.end annotation


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 35
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static arrayToList(Ljava/lang/Object;)Ljava/util/List;
    .locals 1
    .parameter "source"

    .prologue
    .line 67
    invoke-static {p0}, Lorg/springframework/util/ObjectUtils;->toObjectArray(Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public static contains(Ljava/util/Enumeration;Ljava/lang/Object;)Z
    .locals 2
    .parameter "enumeration"
    .parameter "element"

    .prologue
    .line 138
    if-eqz p0, :cond_1

    .line 139
    :cond_0
    invoke-interface {p0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v1

    if-nez v1, :cond_2

    .line 146
    :cond_1
    const/4 v1, 0x0

    :goto_0
    return v1

    .line 140
    :cond_2
    invoke-interface {p0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v0

    .line 141
    .local v0, candidate:Ljava/lang/Object;
    invoke-static {v0, p1}, Lorg/springframework/util/ObjectUtils;->nullSafeEquals(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 142
    const/4 v1, 0x1

    goto :goto_0
.end method

.method public static contains(Ljava/util/Iterator;Ljava/lang/Object;)Z
    .locals 2
    .parameter "iterator"
    .parameter "element"

    .prologue
    .line 120
    if-eqz p0, :cond_1

    .line 121
    :cond_0
    invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_2

    .line 128
    :cond_1
    const/4 v1, 0x0

    :goto_0
    return v1

    .line 122
    :cond_2
    invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    .line 123
    .local v0, candidate:Ljava/lang/Object;
    invoke-static {v0, p1}, Lorg/springframework/util/ObjectUtils;->nullSafeEquals(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 124
    const/4 v1, 0x1

    goto :goto_0
.end method

.method public static containsAny(Ljava/util/Collection;Ljava/util/Collection;)Z
    .locals 4
    .parameter "source"
    .parameter "candidates"

    .prologue
    const/4 v1, 0x0

    .line 176
    invoke-static {p0}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v2

    if-nez v2, :cond_0

    invoke-static {p1}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 184
    :cond_0
    :goto_0
    return v1

    .line 179
    :cond_1
    invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_2
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_0

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    .line 180
    .local v0, candidate:Ljava/lang/Object;
    invoke-interface {p0, v0}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 181
    const/4 v1, 0x1

    goto :goto_0
.end method

.method public static containsInstance(Ljava/util/Collection;Ljava/lang/Object;)Z
    .locals 3
    .parameter "collection"
    .parameter "element"

    .prologue
    .line 158
    if-eqz p0, :cond_1

    .line 159
    invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-nez v2, :cond_2

    .line 165
    :cond_1
    const/4 v1, 0x0

    :goto_0
    return v1

    .line 159
    :cond_2
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    .line 160
    .local v0, candidate:Ljava/lang/Object;
    if-ne v0, p1, :cond_0

    .line 161
    const/4 v1, 0x1

    goto :goto_0
.end method

.method public static findCommonElementType(Ljava/util/Collection;)Ljava/lang/Class;
    .locals 5
    .parameter "collection"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Collection;",
            ")",
            "Ljava/lang/Class",
            "<*>;"
        }
    .end annotation

    .prologue
    const/4 v2, 0x0

    .line 286
    invoke-static {p0}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v3

    if-eqz v3, :cond_1

    move-object v0, v2

    .line 300
    :cond_0
    :goto_0
    return-object v0

    .line 289
    :cond_1
    const/4 v0, 0x0

    .line 290
    .local v0, candidate:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_2
    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    .line 291
    .local v1, val:Ljava/lang/Object;
    if-eqz v1, :cond_2

    .line 292
    if-nez v0, :cond_3

    .line 293
    invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    goto :goto_1

    .line 295
    :cond_3
    invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    if-eq v0, v4, :cond_2

    move-object v0, v2

    .line 296
    goto :goto_0
.end method

.method public static findFirstMatch(Ljava/util/Collection;Ljava/util/Collection;)Ljava/lang/Object;
    .locals 4
    .parameter "source"
    .parameter "candidates"

    .prologue
    const/4 v1, 0x0

    .line 197
    invoke-static {p0}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v2

    if-nez v2, :cond_0

    invoke-static {p1}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v2

    if-eqz v2, :cond_1

    :cond_0
    move-object v0, v1

    .line 205
    :goto_0
    return-object v0

    .line 200
    :cond_1
    invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_2
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_3

    move-object v0, v1

    .line 205
    goto :goto_0

    .line 200
    :cond_3
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    .line 201
    .local v0, candidate:Ljava/lang/Object;
    invoke-interface {p0, v0}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    goto :goto_0
.end method

.method public static findValueOfType(Ljava/util/Collection;Ljava/lang/Class;)Ljava/lang/Object;
    .locals 5
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection",
            "<*>;",
            "Ljava/lang/Class",
            "<TT;>;)TT;"
        }
    .end annotation

    .prologue
    .local p0, collection:Ljava/util/Collection;,"Ljava/util/Collection<*>;"
    .local p1, type:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    const/4 v2, 0x0

    .line 217
    invoke-static {p0}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v3

    if-eqz v3, :cond_1

    move-object v1, v2

    .line 230
    :cond_0
    :goto_0
    return-object v1

    .line 220
    :cond_1
    const/4 v1, 0x0

    .line 221
    .local v1, value:Ljava/lang/Object;,"TT;"
    invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v3

    .end local v1           #value:Ljava/lang/Object;,"TT;"
    :cond_2
    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    .line 222
    .local v0, element:Ljava/lang/Object;
    if-eqz p1, :cond_3

    invoke-virtual {p1, v0}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 223
    :cond_3
    if-eqz v1, :cond_4

    move-object v1, v2

    .line 225
    goto :goto_0

    .line 227
    :cond_4
    move-object v1, v0

    .restart local v1       #value:Ljava/lang/Object;,"TT;"
    goto :goto_1
.end method

.method public static findValueOfType(Ljava/util/Collection;[Ljava/lang/Class;)Ljava/lang/Object;
    .locals 5
    .parameter
    .parameter "types"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Collection",
            "<*>;[",
            "Ljava/lang/Class",
            "<*>;)",
            "Ljava/lang/Object;"
        }
    .end annotation

    .prologue
    .local p0, collection:Ljava/util/Collection;,"Ljava/util/Collection<*>;"
    const/4 v2, 0x0

    .line 243
    invoke-static {p0}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v3

    if-nez v3, :cond_0

    invoke-static {p1}, Lorg/springframework/util/ObjectUtils;->isEmpty([Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    :cond_0
    move-object v1, v2

    .line 252
    :cond_1
    :goto_0
    return-object v1

    .line 246
    :cond_2
    array-length v4, p1

    const/4 v3, 0x0

    :goto_1
    if-lt v3, v4, :cond_3

    move-object v1, v2

    .line 252
    goto :goto_0

    .line 246
    :cond_3
    aget-object v0, p1, v3

    .line 247
    .local v0, type:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    invoke-static {p0, v0}, Lorg/springframework/util/CollectionUtils;->findValueOfType(Ljava/util/Collection;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v1

    .line 248
    .local v1, value:Ljava/lang/Object;
    if-nez v1, :cond_1

    .line 246
    add-int/lit8 v3, v3, 0x1

    goto :goto_1
.end method

.method public static hasUniqueObject(Ljava/util/Collection;)Z
    .locals 6
    .parameter "collection"

    .prologue
    const/4 v3, 0x0

    .line 262
    invoke-static {p0}, Lorg/springframework/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 276
    :goto_0
    return v3

    .line 265
    :cond_0
    const/4 v2, 0x0

    .line 266
    .local v2, hasCandidate:Z
    const/4 v0, 0x0

    .line 267
    .local v0, candidate:Ljava/lang/Object;
    invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v4

    .end local v0           #candidate:Ljava/lang/Object;
    :cond_1
    :goto_1
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-nez v5, :cond_2

    .line 276
    const/4 v3, 0x1

    goto :goto_0

    .line 267
    :cond_2
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    .line 268
    .local v1, elem:Ljava/lang/Object;
    if-nez v2, :cond_3

    .line 269
    const/4 v2, 0x1

    .line 270
    move-object v0, v1

    .restart local v0       #candidate:Ljava/lang/Object;
    goto :goto_1

    .line 272
    .end local v0           #candidate:Ljava/lang/Object;
    :cond_3
    if-eq v0, v1, :cond_1

    goto :goto_0
.end method

.method public static isEmpty(Ljava/util/Collection;)Z
    .locals 1
    .parameter "collection"

    .prologue
    .line 44
    if-eqz p0, :cond_0

    invoke-interface {p0}, Ljava/util/Collection;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public static isEmpty(Ljava/util/Map;)Z
    .locals 1
    .parameter "map"

    .prologue
    .line 54
    if-eqz p0, :cond_0

    invoke-interface {p0}, Ljava/util/Map;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public static mergeArrayIntoCollection(Ljava/lang/Object;Ljava/util/Collection;)V
    .locals 4
    .parameter "array"
    .parameter "collection"

    .prologue
    .line 77
    if-nez p1, :cond_0

    .line 78
    new-instance v2, Ljava/lang/IllegalArgumentException;

    const-string v3, "Collection must not be null"

    invoke-direct {v2, v3}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v2

    .line 80
    :cond_0
    invoke-static {p0}, Lorg/springframework/util/ObjectUtils;->toObjectArray(Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    .line 81
    .local v0, arr:[Ljava/lang/Object;
    array-length v3, v0

    const/4 v2, 0x0

    :goto_0
    if-lt v2, v3, :cond_1

    .line 84
    return-void

    .line 81
    :cond_1
    aget-object v1, v0, v2

    .line 82
    .local v1, elem:Ljava/lang/Object;
    invoke-interface {p1, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z

    .line 81
    add-int/lit8 v2, v2, 0x1

    goto :goto_0
.end method

.method public static mergePropertiesIntoMap(Ljava/util/Properties;Ljava/util/Map;)V
    .locals 5
    .parameter "props"
    .parameter "map"

    .prologue
    .line 96
    if-nez p1, :cond_0

    .line 97
    new-instance v3, Ljava/lang/IllegalArgumentException;

    const-string v4, "Map must not be null"

    invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 99
    :cond_0
    if-eqz p0, :cond_1

    .line 100
    invoke-virtual {p0}, Ljava/util/Properties;->propertyNames()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, en:Ljava/util/Enumeration;
    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v3

    if-nez v3, :cond_2

    .line 110
    .end local v0           #en:Ljava/util/Enumeration;
    :cond_1
    return-void

    .line 101
    .restart local v0       #en:Ljava/util/Enumeration;
    :cond_2
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 102
    .local v1, key:Ljava/lang/String;
    invoke-virtual {p0, v1}, Ljava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 103
    .local v2, value:Ljava/lang/String;
    if-nez v2, :cond_3

    .line 105
    invoke-virtual {p0, v1}, Ljava/util/Properties;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    .line 107
    .end local v2           #value:Ljava/lang/String;
    :cond_3
    invoke-interface {p1, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0
.end method

.method public static toIterator(Ljava/util/Enumeration;)Ljava/util/Iterator;
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Enumeration",
            "<TE;>;)",
            "Ljava/util/Iterator",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 309
    .local p0, enumeration:Ljava/util/Enumeration;,"Ljava/util/Enumeration<TE;>;"
    new-instance v0, Lorg/springframework/util/CollectionUtils$EnumerationIterator;

    invoke-direct {v0, p0}, Lorg/springframework/util/CollectionUtils$EnumerationIterator;-><init>(Ljava/util/Enumeration;)V

    return-object v0
.end method
